<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            p{
                background-color: lightgreen;
                width:200px;
                font-size: 36px;
                line-height: 36px;
                text-align: center;
            }
            .v-leave-active{
                transition : opacity 3s ease;
            }
            .v-leave{
                opacity: 1;
            }
            .v-leave-to{
                opacity: 0;
            }
            .v-enter-active{
                transition : opacity 3s ease;
            }
            .v-enter{
                opacity: 0;
            }
            .v-enter-to{
                opacity: 1;
            }
        </style>
    </head>
    <body>
        <div id="app">
            <button @click="toggle">toggle</button>
            <transition>
                <p v-if="show">Hello</p>
            </transition>
        </div>
        <script src="vue.js"></script>
        <script>
        var vm = new Vue({
            el:'#app',
            data:{show:true},
            methods:{
                toggle(){
                    this.show = !this.show;
                }
            }
        });
    </script>
    </body>
</html>